package com.drojian.demo1.root_fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo1.test6.MyAddControlActivity;
import com.drojian.demo1.test6.MyPropertyActivity;
import com.drojian.demo1.test6.RootMyViewActivity;
import com.drojian.demo1.test6.RootViewGroupActivity;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link RootFragment6#newInstance} factory method to
 * create an instance of this fragment.
 */
public class RootFragment6 extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.ui1_fragment_root6, container, false);
        Button myView = view.findViewById(R.id.myView);
        Button myViewGroup = view.findViewById(R.id.myViewGroup);
        Button myControl = view.findViewById(R.id.myControl);
        Button myProperty = view.findViewById(R.id.myProperty);


        myView.setOnClickListener(v -> startActivity(new Intent(getContext(), RootMyViewActivity.class)));
        myViewGroup.setOnClickListener(v -> startActivity(new Intent(getContext(), RootViewGroupActivity.class)));
        myControl.setOnClickListener(v -> startActivity(new Intent(getContext(), MyAddControlActivity.class)));
        myProperty.setOnClickListener(v -> startActivity(new Intent(getContext(), MyPropertyActivity.class)));


        return view;
    }
    public static RootFragment6 newInstance() {
        return new RootFragment6();
    }
}